package com.cn.question;

import org.junit.Test;

public class NullProblem {
    @Test
     public void test1(){
         String s = null;
         System.out.println(s.equals("test")); // 运行时报错：NullPointerException
     }

     @Test
     public void test2(){
         String s = null;
         System.out.println("test".equals(s)); // 安全，输出 false
     }
}
